<template>
  <div class="me">
    <Header :isFixed="isFixed"></Header>
    <div class="container" :class="isFixed ? 'mgtop' : ''">
      <div class="row">
        <div class="col-md-4 left">
          <UserInfoControl :data="user"></UserInfoControl>
        </div>
        <div class="col-md-8">
          <div class="container_title">
            <UserInfoWelcome :data="user"></UserInfoWelcome>
          </div>
          <div
            class="es-divider es-divider-horizontal es-divider-default"
          ></div>
          <div class="container_title small">
            <TitleControl
              :title="user.nickName + '\'s Listings'"
              desc="Her (his) dynamic list"
            ></TitleControl>
          </div>
          <div class="container_list">
            <MessageListControl :data="historyData" :isSelect="false">
              <template slot="msgTools">
                <RadioGroup></RadioGroup>
              </template>
            </MessageListControl>
          </div>
        </div>
      </div>
      <Pagination></Pagination>
      <div class="container_aboutme">
        <AboutMeControl></AboutMeControl>
      </div>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
export default {
  name: "Me",
  props: {
    isFixed: {
      type: Boolean,
      default() {
        return false;
      },
    },
  },
  data() {
    return {
      user: {
        nickName: "Nick Name",
        avatar: "https://booking.webestica.com/assets/images/avatar/01.jpg",
        email: "ereddate@gmail.com",
        location: "Hainan, China",
        phone: "15800000000",
        desc: `Samsa was a travelling salesman - and above it there hung a
              picture that he had recently cut out of an illustrated magazine
              and housed in a nice, gilded frame. He must have tried it a
              hundred times, shut his eyes so that he wouldn't have to look at
              the floundering legs, and only stopped when he began to feel a
              mild, dull pain there that he had never felt before.`,
        joinTime: "2022",
      },
      historyData: [],
    };
  },
  components: {
    Header: () =>
      import(
        /* webpackChunkName:'header' */ "@/components/header/components/index.vue"
      ),
    Footer: () =>
      import(
        /* webpackChunkName:'footer' */ "@/components/footer/components/index.vue"
      ),
    UserInfoControl: () =>
      import(
        /* webpackChunkName:'userInfoControl' */ "@/components/userInfoControl/components/index.vue"
      ),
    AboutMeControl: () =>
      import(
        /* webpackChunkName:'aboutMeControl' */ "@/components/aboutMeControl/components/index.vue"
      ),
    Pagination: () =>
      import(
        /* webpackChunkName:'pagination' */ "@/components/pagination/components/index.vue"
      ),
    MessageListControl: () =>
      import(
        /* webpackChunkName:'messageListControl' */ "@/components/messageListControl/components/index.vue"
      ),
    RadioGroup: () =>
      import(
        /* webpackChunkName:'radioGroup' */ "@/components/radioGroup/components/index.vue"
      ),
    UserInfoWelcome: () =>
      import(
        /* webpackChunkName:'userInfoWelcome' */ "@/components/userInfoControl/components/welcome.vue"
      ),
    TitleControl: () =>
      import(
        /* webpackChunkName:'titleControl' */ "@/components/titleControl/components/index.vue"
      ),
  },
  created() {
    let historyArr = [];
    for (let i = 0; i < 10; i++)
      historyArr.push({
        id: "123456",
        avater: "https://booking.webestica.com/assets/images/avatar/01.jpg",
        msg: `One morning, when Gregor Samsa woke from troubled dreams, he
                found himself transformed in his bed into a horrible vermin. He
                lay on his armour-like back, and if he lifted his head a little
                he could see his brown belly, slightly domed and divided by
                arches into stiff sections`,
        time: "February 16, 2019",
      });
    this.historyData = [...historyArr];
  },
};
</script>

<style lang="scss">
.me {
  .container {
    padding: 0.625rem 0.9375rem;
    &.mgtop {
      margin-top: 3.5rem;
    }
    .left {
    }
    .container_title {
    }
    .container_aboutme {
    }
  }
}
</style>
